<template>
	<view class="content-box">
		<u-navbar :border-bottom="false" title="" back-icon-name="nav-back" back-icon-color="#666666" :custom-back="tui.goBack">
			<!-- <view class="slot-wrap" slot="right">
				<image src="/static/market/share.png"></image>
			</view> -->
		</u-navbar>
	 	<view class="content" v-if="articInfo">
			<h2>{{articInfo.title}}</h2>
			<view class="unpdate-titme">{{articInfo.created_at}}</view>
			<view class="fz-28 text-#343A40 text-justify" style="line-height: 48upx;">
				<u-parse :html="articInfo.content" :tag-style="style"></u-parse>
			</view>
		</view> 
		<u-loadmore status="loading" v-show="loading" margin-top="50"/>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				style:{
					p: 'text-indent: 2em',
					img:'margin:0 auto;display:block'
				},
				articInfo: null,
				loading:true
			}
		},
		onLoad(options) {
			this.id = options.id
			this.articleShow()
		},
		methods: {
			articleShow() {
				this.loading = true
				this.$store.dispatch('public/articlesShow', { id: this.id }).then(res => {
					this.articInfo = res.data
					this.loading = false
				}).catch(error=>{
					this.loading = false
				})
			}
		}

	}
</script>

<style lang="scss" scoped>
	.content-box {
		width: 100%;
		min-height: 100vh;
		background: #fff;
		
		.slot-wrap {
			padding: 0 30upx;
			box-sizing: border-box;
			display: flex;
			justify-content: right;
			align-items: center;
			flex: 1;
			image{
				width: 40upx;
				height: 40upx;
				vertical-align: top;
			}
		}
		.content {
			width: 100%;
			padding: 27upx 30upx;
			box-sizing: border-box;
			h2 {
				font-size: 36upx;
				line-height: 67upx;
				padding: 0 0 20upx 0;
				color: #343A40;
				font-weight: bold;
			}

			.unpdate-titme {
				height: 37upx;
				font-size: 28upx;
				font-family: PingFang-SC-Medium, PingFang-SC;
				font-weight: 500;
				color: #ADB5BD;
				line-height: 37upx;
				margin-bottom: 39upx;
			}
		}
	}
</style>
